/**
 * 
 * If you have edited the file, please update
 * all the last-modified fields manually. Thanks!
 *
 * @last-modified by: 
 * @last-modified date: 
 * @last-modified time: 
 *
 * @author Swee Zhi
 * @date-created Sep 12, 2011    @time-created 6:57:41 PM
 *
 * @project: 
 * @module: 
 * @institution: 
 *
 */
package util.enumhelper;

import util.enumeration.CuisineType;
import util.enumeration.Language;

public class LocalizedCuisineType {

    // alphabetical order
    public static String getLocalizedCuisineTypeAsString(CuisineType cuisineType, String locale) {
        String localizedCuisineType = "";
        
        // en_US ENGLISH, UNITED STATES
        if (locale.equals(SupportedLocale.getSupportedLocale(Language.ENGLISH_US))) {
            localizedCuisineType = getCuisineType_EN_US(cuisineType);
        }
        // en_SG ENGLISH, SINGAPORE
        else
        if (locale.equals(SupportedLocale.getSupportedLocale(Language.ENGLISH_SINGAPORE))) {
            localizedCuisineType = getCuisineType_EN_SG(cuisineType);
        }
        // ms_MY MALAY, MALAYSIA
        else
        if (locale.equals(SupportedLocale.getSupportedLocale(Language.MALAY))) {
            localizedCuisineType = getCuisineType_MS_MY(cuisineType);
        }
        
        // zh_CN CHINESE, CHINA
        else
        if (locale.equals(SupportedLocale.getSupportedLocale(Language.CHINESE_CHINA))) {
            localizedCuisineType = getCuisineType_ZH_CN(cuisineType);
        }
        // other language...
        else {
            localizedCuisineType = getCuisineType_EN_US(cuisineType);
        }
        
        return localizedCuisineType;
    }
    
    // simplified chinese (zh_CN)
    private static String getCuisineType_ZH_CN(CuisineType cuisineType) {
        String localizedCuisineType = "";
        
        switch (cuisineType) {
            case CHINESE: localizedCuisineType = "中国菜" ; break;
            case CANTONESE: localizedCuisineType = "粤菜"; break;
            case HAINANESE: localizedCuisineType = "海南美食"; break;
            case HAKKA: localizedCuisineType = "客家菜"; break;
            case HOKKIEN: localizedCuisineType = "福建美食"; break;
            case FUJIAN: localizedCuisineType = "闽菜"; break;
            case SHANGHAI: localizedCuisineType = "上海菜"; break;
            case TEOCHEW: localizedCuisineType = "潮州美食"; break;
            case XINJIANG: localizedCuisineType = "新疆美食"; break;
            case MALAY: localizedCuisineType = "马来美食"; break;
            case INDIAN: localizedCuisineType = "印度美食"; break;
            case WESTERN: localizedCuisineType = "中西美食"; break;
            case JAPANESE: localizedCuisineType = "日本料理"; break;
            case KOREAN: localizedCuisineType = "韩国料理"; break;
        }
        return localizedCuisineType;
    }
    
    // default (en_US)
    private static String getCuisineType_EN_US(CuisineType cuisineType) {
        String localizedCuisineType = "";
        
        switch (cuisineType) {
            case CHINESE: localizedCuisineType = "Chinese" ; break;
            case CANTONESE: localizedCuisineType = "Cantonese"; break;
            case HAINANESE: localizedCuisineType = "Hainanese"; break;
            case HAKKA: localizedCuisineType = "Hakka"; break;
            case HOKKIEN: localizedCuisineType = "Hokkien"; break;
            case FUJIAN: localizedCuisineType = "Fujian"; break;
            case SHANGHAI: localizedCuisineType = "Shanghai"; break;
            case TEOCHEW: localizedCuisineType = "Teochew"; break;
            case XINJIANG: localizedCuisineType = "Xinjiang"; break;
            case MALAY: localizedCuisineType = "Malay"; break;
            case INDIAN: localizedCuisineType = "Indian"; break;
            case WESTERN: localizedCuisineType = "Western"; break;
            case JAPANESE: localizedCuisineType = "Japanese"; break;
            case KOREAN: localizedCuisineType = "Korean"; break;
        }
        return localizedCuisineType;
    }
    
    // singapore english (en_SG)
    private static String getCuisineType_EN_SG(CuisineType cuisineType) {
        String localizedCuisineType = "";
        
        switch (cuisineType) {
            case CHINESE: localizedCuisineType = "Chinese" ; break;
            case CANTONESE: localizedCuisineType = "Cantonese"; break;
            case HAINANESE: localizedCuisineType = "Hainanese"; break;
            case HAKKA: localizedCuisineType = "Hakka"; break;
            case HOKKIEN: localizedCuisineType = "Hokkien"; break;
            case FUJIAN: localizedCuisineType = "Fujian"; break;
            case SHANGHAI: localizedCuisineType = "Shanghai"; break;
            case TEOCHEW: localizedCuisineType = "Teochew"; break;
            case XINJIANG: localizedCuisineType = "Xinjiang"; break;
            case MALAY: localizedCuisineType = "Malay"; break;
            case INDIAN: localizedCuisineType = "Indian"; break;
            case WESTERN: localizedCuisineType = "Western"; break;
            case JAPANESE: localizedCuisineType = "Japanese"; break;
            case KOREAN: localizedCuisineType = "Korean"; break;
        }
        return localizedCuisineType;
    }
    
    // bahasa malaysia (ms_MY)
    private static String getCuisineType_MS_MY(CuisineType cuisineType) {
        String localizedCuisineType = "";
        
        switch (cuisineType) {
            case CHINESE: localizedCuisineType = "Cina" ; break;
            case CANTONESE: localizedCuisineType = "Kantonis"; break;
            case HAINANESE: localizedCuisineType = "Hainan"; break;
            case HAKKA: localizedCuisineType = "Hakka"; break;
            case HOKKIEN: localizedCuisineType = "Hokkien"; break;
            case FUJIAN: localizedCuisineType = "Fujian"; break;
            case SHANGHAI: localizedCuisineType = "Shanghai"; break;
            case TEOCHEW: localizedCuisineType = "Teochew"; break;
            case XINJIANG: localizedCuisineType = "Xinjiang"; break;
            case MALAY: localizedCuisineType = "Melayu"; break;
            case INDIAN: localizedCuisineType = "India"; break;
            case WESTERN: localizedCuisineType = "Western"; break;
            case JAPANESE: localizedCuisineType = "Jepun"; break;
            case KOREAN: localizedCuisineType = "Korea"; break;
        }
        return localizedCuisineType;
    }
    
    // new cuisineType for localized language template (copy and paste to use)
//    private static String getCuisineType_XX_YY(CuisineType cuisineType) {
//        String localizedCuisineType = "";
//        
//        switch (cuisineType) {
//            case CHINESE: localizedCuisineType = "" ; break;
//            case CANTONESE: localizedCuisineType = ""; break;
//            case HAINANESE: localizedCuisineType = ""; break;
//            case HAKKA: localizedCuisineType = ""; break;
//            case HOKKIEN: localizedCuisineType = ""; break;
//            case FUJIAN: localizedCuisineType = ""; break;
//            case SHANGHAI: localizedCuisineType = ""; break;
//            case TEOCHEW: localizedCuisineType = ""; break;
//            case XINJIANG: localizedCuisineType = ""; break;
//            case MALAY: localizedCuisineType = ""; break;
//            case INDIAN: localizedCuisineType = ""; break;
//            case WESTERN: localizedCuisineType = ""; break;
//            case JAPANESE: localizedCuisineType = ""; break;
//            case KOREAN: localizedCuisineType = ""; break;
//        }
//        return localizedCuisineType;
//    }
}
